<?php
/*
 * @Author: 持禅 1791106511@qq.com
 * @Date: 2023-11-06 08:31:29
 * @LastEditors: 持禅 1791106511@qq.com
 * @LastEditTime: 2023-11-06 13:43:24
 * @FilePath: \yuce.top\app\api\controller\User.php
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
namespace app\api\controller;
use think\facade\{View,Session,Db};
use app\BaseController;

class User extends Common
{

   
    public function feedback(){
        $uid=$this->getUid();
        $content=trim(input('content'));
        // if(!$content){
        //     return returnmsg(199,"内容不能为空");
        // }
        if(!yzmobile(input('mobile'))){
            return returnmsg(199,"手机号格式错误");
        }
        if(!input('type')){
            return returnmsg(199,"请选择反馈类型");
        }
        Db::name("feedback")->insert([
            'sn'=>'8'.rand(1000,9999).time(),
            'iuser_id'=>$uid,
            'content'=>$content,
            'addtime'=>time(),
            'mobile'=>input('mobile'),
            'va_sn'=>input('va_sn'),
            'type'=>input('type'),
        ]);
        return returnmsg(200,"提交成功");
    }
 
    

   
}


